﻿/*说明：统一从 $("#hdReportNumber").val() 获取项目号 */
$(function () {
    var substrid;
    var state;
    var url = window.location.search;
    var request = new Object();
    if (url.indexOf("?") != -1) {  //<!--判断是否存在，如果返回-1，则表明不存在-->
        var str = url.substr(1);   //<!--从第1个字符开始截取-->
        var strs = str.split("&"); //<!--表示以“&’”为分隔符进行分隔，返回的是一个数组-->
        for (var i = 0; i < strs.length; i++) {
            request[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
        }
        substrid = request["T_ReportNumber"];
        state = request["T_State"];
    }

    $("#navReportNumber").html(substrid);//给面包屑导航赋值
    $("#hdReportNumber").val(substrid)//隐藏域储存值

    window.fileState = 1;//附件状态：1是执行成功，0是添加失败,-1是文件类型不符合要求，-2是服务器连接失败；

    //tabs 选项卡
    $.Huitab("#tab-Base>.tabBar>span", "#tab-Base>.tabCon", "current", "click", "0");
    $.Huitab("#myTab>.tabBar>span", "#myTab>.tabCon", "current", "click", "0");

    //权属折叠
    $.Huifold("#QuanShuHuifold .item h4", "#QuanShuHuifold .item .info", "fast", 1, "click"); /*5个参数顺序不可打乱，分别是：相应区,隐藏显示的内容,速度,类型,事件*/

    //图片上传 特效
    $.Huihover(".portfolio-area li");

    //复选框
    $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });
    //勘察信息，所有字典下拉框加载
    DictionarySelect();

    /*基本信息的显示*/
    $.ajax({
        type: "get",
        url: ApiUrl + "api/Personal/SelectPersonaByReportNumber",
        data: { P_ReportNumber: substrid },
        async: false,
        success: function (data, status) {
            if (status == "success") {
                $("#T_ReportNumber").val(data[0].T_ReportNumber)
                $("#T_Linkman").val(data[0].T_Linkman)
                $("#T_Phone").val(data[0].T_Phone)
                $("#T_Loanyear").val(data[0].T_Loanyear)
                $("#T_Loanlimit").val(data[0].T_Loanlimit)
                $("#T_Actual").val(data[0].T_Actual)
                $("#T_Located").val(data[0].T_Located)
                $("#T_PurposeID").val(data[0].T_PurposeID)
                $("#T_Activate").val(data[0].T_Activate)
                $("#T_ReportID").val(data[0].T_ReportID)
                $("#T_Assess").val(data[0].T_Assess)
                $("#T_DepartmentID").val(data[0].T_DepartmentID)
                $("#T_SiteSurveyid").val(data[0].T_SiteSurveyid)
                $("#T_Date").val(data[0].T_Date)
                $("#T_State").val(data[0].T_State)
                if (data[1] != null && data[1] != undefined) {
                    var a = [];
                    var b = [];
                    var c = [];
                    $(data[1]).each(function (i, item) {
                        a.push(item.T_Name);
                        b.push(item.T_Idcard);
                        c.push(item.T_Phone);
                    })
                    $("#JT_Name").val(a);
                    $("#JT_Idcard").val(b);
                    $("#JT_Phone").val(c);
                }
            }
        }
    })

    //查询勘查信息
    $("#spanbar3").click(function () {
        if (substrid == null || substrid == "" || substrid == undefined) {
            layer.msg('查询异常!', { icon: 2, time: 1000 });
        }
        //根据项目号回填勘查数据
        $.ajax({
            type: "get",
            url: ApiUrl + "api/Personal/SelectProspecting",
            data: { T_ReportNumber: substrid },
            async: false,
            success: function (data, status) {
                if (status == "success") {
                    if (data.Message == "error") {
                        layer.alert("错误！", { icon: 2, });
                    }
                    //抵押物区位状况
                    if (data.Collateral_Zone != null && data.Collateral_Zone != undefined) {
                        $("#T_SurroundID").val(data.Collateral_Zone.T_SurroundID);
                        $("#T_Master").val(data.Collateral_Zone.T_Master);
                        $("#T_South").val(data.Collateral_Zone.T_South);
                        $("#T_Western").val(data.Collateral_Zone.T_Western);
                        $("#T_North").val(data.Collateral_Zone.T_North);
                        $("#T_TrafficID").val(data.Collateral_Zone.T_TrafficID);
                        $("#T_Traffic").val(data.Collateral_Zone.T_Traffic);
                        $("#T_NatureID").val(data.Collateral_Zone.T_NatureID);
                        $("#T_Nature").val(data.Collateral_Zone.T_Nature);
                        $("#T_DwellingID").val(data.Collateral_Zone.T_DwellingID);
                        $("#T_Dwelling").val(data.Collateral_Zone.T_Dwelling);
                        $("#T_InfrastructureID").val(data.Collateral_Zone.T_InfrastructureID);
                        $("#T_Infrastructure").val(data.Collateral_Zone.T_Infrastructure);
                        $("#T_SupportingID").val(data.Collateral_Zone.T_SupportingID);
                        $("#T_Explain").val(data.Collateral_Zone.T_Explain);
                    }
                    //小区状况
                    if (data.Collateral_Community != null && data.Collateral_Community != undefined) {
                        $("#T_Project").val(data.Collateral_Community.T_Project);
                        $("#T_SourceID").val(data.Collateral_Community.T_SourceID);
                        $("#T_CloseID").val(data.Collateral_Community.T_CloseID);
                        $("#T_BuildingID").val(data.Collateral_Community.T_BuildingID);
                        $("#T_TrafficZuzhiID").val(data.Collateral_Community.T_TrafficZuzhiID);
                        $("#T_AfforestID").val(data.Collateral_Community.T_AfforestID);
                        $("#T_VolumeID").val(data.Collateral_Community.T_VolumeID);
                        $("#T_StallID").val(data.Collateral_Community.T_StallID);
                        $("#T_PropertyID").val(data.Collateral_Community.T_PropertyID);
                        $("#T_Else").val(data.Collateral_Community.T_Else);
                    }

                    //公共建筑部位
                    if (data.Collateral_Facility != null && data.Collateral_Facility != undefined) {
                        $("#T_Buildingafew").val(data.Collateral_Facility.T_Buildingafew);
                        $("#T_Location").val(data.Collateral_Facility.T_Location);
                        $("#T_LocationAddress").val(data.Collateral_Facility.T_LocationAddress);
                        $("#T_StructureID").val(data.Collateral_Facility.T_StructureID);
                        $("#T_TypesID").val(data.Collateral_Facility.T_TypesID);
                        $("#T_FacadeID").val(data.Collateral_Facility.T_FacadeID);
                        $("#T_CommonalityID").val(data.Collateral_Facility.T_CommonalityID);
                        $("#T_ElevatorID").val(data.Collateral_Facility.T_ElevatorID);
                        $("#T_SupplyID").val(data.Collateral_Facility.T_SupplyID);
                        $("#T_WaterID").val(data.Collateral_Facility.T_WaterID);
                        $("#T_HeatingID").val(data.Collateral_Facility.T_HeatingID);
                        $("#T_EntranceID").val(data.Collateral_Facility.T_EntranceID);
                        $("#T_Else3").val(data.Collateral_Facility.T_Else);
                    }

                    //户内部分
                    if (data.Collateral_Indoor != null && data.Collateral_Indoor != undefined) {
                        //根据报告号判断户内部分有没有以前填写的数据如果有回填
                        $("#T_purposeID").val(data.Collateral_Indoor.T_purposeID);
                        $("#T_Floor").val(data.Collateral_Indoor.T_Floor);
                        $("#T_Storey").val(data.Collateral_Indoor.T_Storey);
                        $("#T_OrientationID").val(data.Collateral_Indoor.T_OrientationID);
                        $("#T_ResidenceID").val(data.Collateral_Indoor.T_ResidenceID);
                        $("#T_SeveralBedroom").val(data.Collateral_Indoor.T_SeveralBedroom);
                        $("#T_Severaldrawing").val(data.Collateral_Indoor.T_Severaldrawing);
                        $("#T_Severalbathroom").val(data.Collateral_Indoor.T_Severalbathroom);
                        $("#T_SeveralKITCHEN").val(data.Collateral_Indoor.T_SeveralKITCHEN);
                        $("#T_Severalbalcony").val(data.Collateral_Indoor.T_Severalbalcony);
                        $("#T_SeveralTerrace").val(data.Collateral_Indoor.T_SeveralTerrace);
                        $("#T_SeveralSmall").val(data.Collateral_Indoor.T_SeveralSmall);
                        $("#T_DrawingID").val(data.Collateral_Indoor.T_DrawingID);
                        $("#T_RoomdescribeID").val(data.Collateral_Indoor.T_RoomdescribeID);
                        if (data.Collateral_Indoor.T_RoomdescribeInteriorwall != "" && data.Collateral_Indoor.T_RoomdescribeInteriorwall != null) {
                            $(data.Collateral_Indoor.T_RoomdescribeInteriorwall.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_RoomdescribeInteriorwall']").prop("checked", true);
                            });
                        }
                        $("#T_RoomdescribeInteriorwallOther").val(data.Collateral_Indoor.T_RoomdescribeInteriorwallOther); //客厅装修选择说明内墙其它
                        if (data.Collateral_Indoor.T_RoomdescribeCeiling != "" && data.Collateral_Indoor.T_RoomdescribeCeiling != null) {
                            $(data.Collateral_Indoor.T_RoomdescribeCeiling.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_RoomdescribeCeiling']").prop("checked", true);
                            });
                        }
                        $("#T_RoomdescribeCeilingOther").val(data.Collateral_Indoor.T_RoomdescribeCeilingOther);      //客厅装修选择说明顶棚其它
                        if (data.Collateral_Indoor.T_RoomdescribeGround != "" && data.Collateral_Indoor.T_RoomdescribeGround != null) {
                            $(data.Collateral_Indoor.T_RoomdescribeGround.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_RoomdescribeGround']").prop("checked", true);
                            });
                        }
                        $("#T_RoomdescribeGroundOther").val(data.Collateral_Indoor.T_RoomdescribeGroundOther);       //客厅装修选择说明地面其它
                        $("#T_HabitableID").val(data.Collateral_Indoor.T_HabitableID);                   //居室装修情况编号（字典）
                        if (data.Collateral_Indoor.T_HabitableInteriorwall != "" && data.Collateral_Indoor.T_HabitableInteriorwall != null) {
                            $(data.Collateral_Indoor.T_HabitableInteriorwall.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_HabitableInteriorwall']").prop("checked", true);
                            });
                        }
                        $("#T_HabitableInteriorwallOther").val(data.Collateral_Indoor.T_HabitableInteriorwallOther);    //居室装修选择说明内墙其它
                        if (data.Collateral_Indoor.T_HabitableCeiling != "" && data.Collateral_Indoor.T_HabitableCeiling != null) {
                            $(data.Collateral_Indoor.T_HabitableCeiling.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_HabitableCeiling']").prop("checked", true);
                            });
                        }
                        $("#T_HabitableCeilingOther").val(data.Collateral_Indoor.T_HabitableCeilingOther);         //居室装修选择说明顶棚其它
                        if (data.Collateral_Indoor.T_HabitableGround != "" && data.Collateral_Indoor.T_HabitableGround != null) {
                            $(data.Collateral_Indoor.T_HabitableGround.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_HabitableGround']").prop("checked", true);
                            });
                        }
                        $("#T_HabitableGroundOther").val(data.Collateral_Indoor.T_HabitableGroundOther);          //居室装修选择说明地面其它
                        $("#T_ToiletID").val(data.Collateral_Indoor.T_ToiletID);                      //卫生间装修情况编号（字典）
                        if (data.Collateral_Indoor.T_ToiletInteriorwall != "" && data.Collateral_Indoor.T_ToiletInteriorwall != null) {
                            $(data.Collateral_Indoor.T_ToiletInteriorwall.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_ToiletInteriorwall']").prop("checked", true);
                            });
                        }
                        $("#T_ToiletInteriorwallOther").val(data.Collateral_Indoor.T_ToiletInteriorwallOther);       //卫生间装修选择说明内墙其它
                        if (data.Collateral_Indoor.T_ToiletCeiling != "" && data.Collateral_Indoor.T_ToiletCeiling != null) {
                            $(data.Collateral_Indoor.T_ToiletCeiling.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_ToiletCeiling']").prop("checked", true);
                            });
                        }
                        $("#T_ToiletCeilingOther").val(data.Collateral_Indoor.T_ToiletCeilingOther);            //卫生间装修选择说明顶棚其它
                        if (data.Collateral_Indoor.T_ToiletGround != "" && data.Collateral_Indoor.T_ToiletGround != null) {
                            $(data.Collateral_Indoor.T_ToiletGround.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_ToiletGround']").prop("checked", true);
                            });
                        }
                        $("#T_ToiletGroundOther").val(data.Collateral_Indoor.T_ToiletGroundOther);             //卫生间装修选择说明地面其它
                        $("#T_KitchenID").val(data.Collateral_Indoor.T_KitchenID);                     //厨房装修情况编号 （字典）
                        if (data.Collateral_Indoor.T_KitchenInteriorwall != "" && data.Collateral_Indoor.T_KitchenInteriorwall != null) {
                            $(data.Collateral_Indoor.T_KitchenInteriorwall.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_KitchenInteriorwall']").prop("checked", true);
                            });
                        }
                        $("#T_KitchenInteriorwallOther").val(data.Collateral_Indoor.T_KitchenInteriorwallOther);      //厨房装修选择说明内墙其它
                        if (data.Collateral_Indoor.T_KitchenCeiling != "" && data.Collateral_Indoor.T_KitchenCeiling != null) {
                            $(data.Collateral_Indoor.T_KitchenCeiling.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_KitchenCeiling']").prop("checked", true);
                            });
                        }
                        $("#T_KitchenCeilingOther").val(data.Collateral_Indoor.T_KitchenCeilingOther);           //厨房装修选择说明顶棚其它
                        if (data.Collateral_Indoor.T_KitchenGround != "" && data.Collateral_Indoor.T_KitchenGround != null) {
                            $(data.Collateral_Indoor.T_KitchenGround.split(",")).each(function (i, dom) {
                                $(":checkbox[value='" + dom + "'][name='T_KitchenGround']").prop("checked", true);
                            });
                        }
                        $("#T_KitchenGroundOther").val(data.Collateral_Indoor.T_KitchenGroundOther);            //厨房装修选择说明地面其它
                        $("#T_Explain4").val(data.Collateral_Indoor.T_Explain);                       //有关说明

                    }
                    //图片
                    $(data.Collateral_SitePicture).each(function (i, item) {
                        $("#" + item.T_Addr + "").html('<img name="image"  src="' + ApiUrl + item.T_Pictureurl + '" class="preview"/>');
                    });
                    //询价记录
                    $("#tbodysCollateral_InquiryRecord").empty();
                    $(data.Collateral_InquiryRecord).each(function (i, item) {
                        var html = Array();
                        html.push('<tr class="text-c">');
                        html.push('<td>' + i + '</td>');
                        html.push('<td>' + item.T_Price + '</td>');
                        html.push('<td>' + item.T_Iname + '</td>');
                        html.push('<td>' + item.T_Date + '</td>');
                        html.push('</tr>');
                        $("#tbodysCollateral_InquiryRecord").append(html.join())

                    });
                }
            }

        })
        layer.closeAll();
    });

})
//勘察信息，所有字典下拉框加载
function DictionarySelect() {
    $.ajax({
        type: "get",
        url: ApiUrl + "api/Dictionary/GetDictionaryList",
        data: {
            Dmenuid: [42, 2, 3, 4, 5, 6, 41, 7, 8, 9, 10, 11, 12, 13,
                14, 15, 16, 17, 18, 19, 20, 21, 22, 1, 23, 24, 25, 26, 43]
        },
        async: false,
        success: function (data, status) {
            if (status == "success") {
                $("#myTab option").remove();
                $(data).each(function (i, obj) {
                    $(obj).each(function (j, item) {
                        switch (item.Dmenuid) {
                            /*抵押物区位状况开始*/
                            case 42:
                                //位置环绕
                                $("#T_SurroundID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 2:
                                //交通便捷度
                                $("#T_TrafficID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 3:
                                //自然人文环境
                                $("#T_NatureID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 4:
                                //居住社区成熟度
                                $("#T_DwellingID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 5:
                                //基础设施配套
                                $("#T_InfrastructureID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 6:
                                //配套设施
                                $("#T_SupportingID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                                /*抵押物区位状况结束*/

                                /*小区状况开始*/
                            case 41:
                                //来源
                                $("#T_SourceID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 7:
                                //小区封闭性
                                $("#T_CloseID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 8:
                                //居住小区楼宇构成
                                $("#T_BuildingID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 9:
                                //交通组织方式
                                $("#T_TrafficZuzhiID").append("<option  value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 10:
                                //景观及绿化
                                $("#T_AfforestID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 11:
                                //容积率
                                $("#T_VolumeID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 12:
                                //车位状况
                                $("#T_StallID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                                //物业公司
                            case 13:
                                $("#T_PropertyID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                                /*小区状况结束*/

                                /*建筑公共部位状况结束*/
                            case 14:
                                $("#T_StructureID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 15:
                                $("#T_TypesID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 16:
                                $("#T_FacadeID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 17:
                                $("#T_CommonalityID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 18:
                                $("#T_ElevatorID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 19:
                                $("#T_SupplyID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 20:
                                $("#T_WaterID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 21:
                                $("#T_HeatingID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 22:
                                $("#T_EntranceID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                                /*建筑公共部位状况结束*/

                                /*户内部位状况开始*/
                            case 1:
                                //房屋实际用途
                                $("#T_purposeID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 23:
                                //朝向
                                $("#T_OrientationID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 24:
                                //住宅类型
                                $("#T_ResidenceID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 25:
                                //有无客厅
                                $("#T_DrawingID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 26:
                                //装修程度
                                $("#T_RoomdescribeID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                $("#T_HabitableID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                $("#T_ToiletID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                $("#T_KitchenID").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                                break;
                            case 43://估价目的
                                $("#T_ValuationPurpose").append("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                            default:
                                break;
                        }
                    })
                })
            }
        }
    })
}
//回填估价信息
function ValuationShow() {
    var state;
    var url = window.location.search;
    var request = new Object();
    if (url.indexOf("?") != -1) {  //<!--判断是否存在，如果返回-1，则表明不存在-->
        var str = url.substr(1);   //<!--从第1个字符开始截取-->
        var strs = str.split("&"); //<!--表示以“&’”为分隔符进行分隔，返回的是一个数组-->
        for (var i = 0; i < strs.length; i++) {
            request[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
        }
        state = request["T_State"];

    }
    $("#assessInfo_1").remove();
    if (state != 2 && state != 4) {
        $("#meter_3").remove();
        $("#meter_2").remove();
        $("#replaceAssessor").remove();
        $("#submit_btn").remove();
        $("#T_ValuationPurpose").prop("disabled", true);
        $("#assessInfo").prepend('<div id="assessInfo_1" class="mt-20"><div class="Huialert Huialert-danger"><i class="icon-remove"></i>当前状态不能操作估价信息</div></div>');
    };

    var T_ReportNumber = $("#hdReportNumber").val();
    $.ajax({
        url: ApiUrl + 'api/Personal/GetEvaluateInfo',
        type: 'post',
        data: { '': T_ReportNumber },
        success: function (data) {
            if (data.code == 1) {
                $("#T_ValuationName").val(data.data.T_SiteSurveyid);
                $("#T_ValuationNameShow").val(data.data.T_ValuationNameShow);
                $("#T_StartDate").val(data.data.T_StartDate);
                $("#T_EndDate").val(data.data.T_EndDate);
                $("#T_ValuationDate").val(data.data.T_ValuationDate);
                $("#T_ValuationPrice").val(data.data.T_ValuationPrice);
                if (data.data.T_Builtuparea != 0)
                {
                    $("#T_Builtuparea").val(data.data.T_Builtuparea);
                }
                $("#T_Valueofassessment").val(data.data.T_Valueofassessment);
                $("#uploadFile_1").attr("href", ApiUrl + data.data.T_ValuationCalculation);
                if (data.data.T_Survey == null)
                {
                    $("#uploadFile_2").attr("onclick", 'parent.layer.msg("您没有上传过附件", { icon: 2, time: 2000 })');
                }
                else
                {
                    $("#uploadFile_2").removeAttr("onclick");
                    $("#uploadFile_2").attr("href", ApiUrl + data.data.T_Survey);
                }

            }
            else {
                parent.layer.msg(data.msg, { icon: 2, time: 2000 })
            }
        }
    });
  
}
//在上传附件时使用的实时回填相关信息
function ValuationShow2() {
    var T_ReportNumber = $("#hdReportNumber").val();
    $.ajax(
        {
            url: ApiUrl + 'api/Personal/GetEvaluateInfo',
            type: 'post',
            data: { '': T_ReportNumber },
            success: function (data) {
                if (data.code == 1) {
                    $("#T_ValuationDate").val(data.data.T_ValuationDate);
                    $("#T_ValuationPrice").val(data.data.T_ValuationPrice);
                    $("#T_Builtuparea").val(data.data.T_Builtuparea);
                    $("#T_Valueofassessment").val(data.data.T_Valueofassessment);
                }
                else {
                    parent.layer.msg(data.msg, { icon: 2, time: 2000 })
                }
            }
        });

}
/*选择估计师*/
function admin_Show(title, url) {
    // parent.layer_show(title, url, '360', '300');
    var html = Array();
    $.ajax(
    {
        url: ApiUrl + 'api/Staff/selectStaff',
        type: 'post',
        async: false,
        success: function (data) {
            html.push('<div class="page-container"><table class="table table-border table-bordered table-bg"><thead><tr class="text-c"><th width="50">名字</th><th width="90">备注</th><th width="100">选择</th></tr></thead><tbody id="tbody1">');
            $(data).each(function () {
                html.push('<tr class="text-c">');
                html.push('<td>' + this.T_Name + '</td>');
                html.push(' <td>暂无</td>');
                html.push('<td class="td-manage"><a title="选择" href="javascript:;" onclick="changeValuation(\'' + this.T_StaffID + '\',\'' + this.T_Name + '\')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a> </td>');
                html.push('</tr>');
            });
            html.push('</tbody></table></div>');
        }
    });

    layer.open({
        type: 1,
        skin: 'layui-layer-rim', //加上边框
        area: ['420px', '240px'], //宽高
        content: html.join("")
    });
}


//更改估价员
function changeValuation(ValuationId, ValuationName) {
    $("#T_ValuationName").val(ValuationId);
    $("#T_ValuationNameShow").val(ValuationName);
    parent.layer.msg('更换估价员成功!', { icon: 1, time: 2000 });
}
//抵押物区位状况添加
function insertZone() {
    var T_ReportNumber = $("#hdReportNumber").val()//报告号的获取
    var T_Master = $("#T_Master").val();                      //（小区四至）东至
    var T_South = $("#T_South").val();                       //（小区四至）南至
    var T_Western = $("#T_Western").val();                     //（小区四至）西至
    var T_North = $("#T_North").val();                       //（小区四至）北至   
    var T_SurroundID = $("#T_SurroundID option:checked").attr("value"); //位置环绕
    var T_TrafficID = $("#T_TrafficID option:checked").attr("value");       //交通便捷度编号
    var T_Traffic = $("#T_Traffic").val();                     //交通便捷情况
    var T_NatureID = $("#T_NatureID option:checked").attr("value");        //自然人文环境编号
    var T_Nature = $("#T_Nature").val();                      //自然人文环境的情况
    var T_DwellingID = $("#T_DwellingID option:checked").attr("value");      //居住社区成熟度编号
    var T_Dwelling = $("#T_Dwelling").val();                    //居住社区成熟情况
    var T_Infrastructure = $("#T_Infrastructure").val();//基础设施配套情况
    var T_InfrastructureID = $("#T_InfrastructureID option:checked").attr("value");//基础设施配套编号
    var T_SupportingID = $("#T_SupportingID option:checked").attr("value");    //配套设施编号
    var T_Explain = $("#T_Explain").val();                     //有关说明
    var parms = {
        T_ReportNumber: T_ReportNumber,
        T_Master: T_Master,     //（小区四至）东至
        T_South: T_South,     //（小区四至）南至
        T_Western: T_Western,     //（小区四至）西至
        T_North: T_North,     //（小区四至）北至    
        T_SurroundID: T_SurroundID,
        T_TrafficID: T_TrafficID,     //交通便捷度编号
        T_Traffic: T_Traffic,     //交通便捷情况
        T_NatureID: T_NatureID,     //自然人文环境编号
        T_Nature: T_Nature,      //自然人文环境的情况
        T_DwellingID: T_DwellingID,     //居住社区成熟度编号
        T_Dwelling: T_Dwelling,     //居住社区成熟情况
        T_InfrastructureID: T_InfrastructureID,     //基础设施配套情况编号
        T_SupportingID: T_SupportingID,    //基础设施配套情况
        T_Explain: T_Explain,     //配套设施编号
        T_Infrastructure: T_Infrastructure,     //有关说明
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Zone/PostInsert",
        data: parms,
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                    layer.msg('保存成功!', { icon: 1, time: 2000 });
                }
                else {
                    layer.msg('保存失败!', { icon: 2, time: 2000 });
                }
            }
        }
    })
}
//小区状况信息添加
function insertCommunity() {
    var T_ReportNumber = $("#hdReportNumber").val();                //报告号的获取
    var T_Project = $("#T_Project").val();                        //项目案名
    var T_SourceID = $("#T_SourceID option:checked").attr("value");     //来源编号
    var T_CloseID = $("#T_CloseID option:checked").attr("value");      //小区封闭性编号
    var T_BuildingID = $("#T_BuildingID option:checked").attr("value");   //居住小区楼宇构成编号   
    var T_TrafficZuzhiID = $("#T_TrafficZuzhiID option:checked").attr("value");    //交通组织方式编号
    var T_AfforestID = $("#T_AfforestID option:checked").attr("value");   //景观及绿化编号
    var T_VolumeID = $("#T_VolumeID option:checked").attr("value");     //容积率编号
    var T_StallID = $("#T_StallID option:checked").attr("value");      //车位编号
    var T_PropertyID = $("#T_PropertyID option:checked").attr("value");   //物业公司编号
    var T_Else = $("#T_Else").val();                     //其他                                 
    var parms = {
        T_ReportNumber: T_ReportNumber,            //报告号的获取
        T_Project: T_Project,                 //项目案名
        T_SourceID: T_SourceID,               //来源编号
        T_CloseID: T_CloseID,           //小区封闭性编号       
        T_BuildingID: T_BuildingID,           //居住小区楼宇构成编号
        T_TrafficZuzhiID: T_TrafficZuzhiID,           //交通组织方式编号
        T_AfforestID: T_AfforestID,            //景观及绿化编号
        T_VolumeID: T_VolumeID,             //容积率编号
        T_StallID: T_StallID,           //车位编号
        T_PropertyID: T_PropertyID,            //物业公司编号
        T_Else: T_Else,             //其他              
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Community/PostInsert",
        data: parms,
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                    layer.msg('保存成功!', { icon: 1, time: 2000 });
                }
                else {
                    layer.msg('保存失败!', { icon: 1, time: 2000 });
                }
            }
        }
    })
}
//建筑公共部位状况的数据添加
function insertFacility() {
    var T_ReportNumber = $("#hdReportNumber").val();//报告号的获取
    var T_Buildingafew = $("#T_Buildingafew").val(); //所在楼
    var T_StructureID = $("#T_StructureID option:checked").attr("value");    //房屋结构
    var T_TypesID = $("#T_TypesID option:checked").attr("value");        //建筑类型
    var T_FacadeID = $("#T_FacadeID option:checked").attr("value");      //外立面装饰
    var T_CommonalityID = $("#T_CommonalityID option:checked").attr("value"); //公共部位装修
    var T_ElevatorID = $("#T_ElevatorID option:checked").attr("value");    //电梯
    var T_SupplyID = $("#T_SupplyID option:checked").attr("value");      //供气
    var T_WaterID = $("#T_WaterID option:checked").attr("value");       //供水
    var T_HeatingID = $("#T_HeatingID option:checked").attr("value");     //供暖
    var T_EntranceID = $("#T_EntranceID option:checked").attr("value");    //门禁系统
    var T_Else = $("#T_Else3").val();                      //其他
    var parms = {
        T_ReportNumber: T_ReportNumber,
        T_Buildingafew: T_Buildingafew,
        T_StructureID: T_StructureID,       //房屋结构
        T_TypesID: T_TypesID,       //建筑类型
        T_FacadeID: T_FacadeID,      //外立面装饰
        T_CommonalityID: T_CommonalityID,      //公共部位装修
        T_ElevatorID: T_ElevatorID,      //电梯
        T_SupplyID: T_SupplyID,      //供气
        T_WaterID: T_WaterID,      //供水
        T_HeatingID: T_HeatingID,      //供暖
        T_EntranceID: T_EntranceID,      //门禁系统
        T_Else: T_Else,      //其他
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Facility/PostInsert",
        data: parms,
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                    layer.msg('保存成功!', { icon: 1, time: 2000 });
                }
                else {
                    layer.msg('保存失败!', { icon: 1, time: 2000 });
                }
            }
        }
    })
}
//户内部分的数据添加
function insertIndoor() {
    var T_ReportNumber = $("#hdReportNumber").val();//报告号的获取
    var T_purposeID = $("#T_purposeID option:checked").attr("value");      //--房实际用途编号
    // var I_Buildingafew = $("#I_Buildingafew").val();           ///多少栋楼
    var T_Floor = $("#T_Floor").val();                      //--总楼层
    var T_Storey = $("#T_Storey").val();                     //--所在楼层
    var T_OrientationID = $("#T_OrientationID option:checked").attr("value");  //--朝向编号
    var T_ResidenceID = $("#T_ResidenceID option:checked").attr("value");    //--住宅类型编号
    var T_SeveralBedroom = $("#T_SeveralBedroom").val();             // --几个卧室
    var T_Severaldrawing = $("#T_Severaldrawing").val();                // --几个客厅
    var T_Severalbathroom = $("#T_Severalbathroom").val();              // --几个卫生间
    var T_SeveralKITCHEN = $("#T_SeveralKITCHEN").val()              // --几个厨房

    var T_Severalbalcony = $("#T_Severalbalcony").val();                // --几个阳台
    var T_SeveralTerrace = $("#T_SeveralTerrace").val();              // --几个露台
    var T_SeveralSmall = $("#T_SeveralSmall").val()              // --几个小院  
    var T_DrawingID = $("#T_DrawingID option:checked").attr("value");          //有无客厅编号（字典）
    var T_RoomdescribeID = $("#T_RoomdescribeID option:checked").attr("value");//有客厅装修情况描述（字典）
    //内墙
    var T_RoomdescribeInteriorwall = [];
    $("input[name='T_RoomdescribeInteriorwall']").each(function () {
        if (this.checked)
            T_RoomdescribeInteriorwall.push(this.value);
    })
    var T_RoomdescribeInteriorwallOther = $("#T_RoomdescribeInteriorwallOther").val();
    //顶棚
    var T_RoomdescribeCeiling = [];
    $("input[name='T_RoomdescribeCeiling']").each(function () {
        if (this.checked)
            T_RoomdescribeCeiling.push(this.value);
    })
    var T_RoomdescribeCeilingOther = $("#T_RoomdescribeCeilingOther").val();
    //地面
    var T_RoomdescribeGround = [];
    $("input[name='T_RoomdescribeGround']").each(function () {
        if (this.checked)
            T_RoomdescribeGround.push(this.value);
    })
    var T_RoomdescribeGroundOther = $("#T_RoomdescribeGroundOther").val();
    //装修程度
    var T_HabitableID = $("#T_HabitableID option:checked").attr("value");
    //内墙
    var T_HabitableInteriorwall = [];
    $("input[name='T_HabitableInteriorwall']").each(function () {
        if (this.checked)
            T_HabitableInteriorwall.push(this.value);
    })
    var T_HabitableInteriorwallOther = $("#T_HabitableInteriorwallOther").val();
    //顶棚
    var T_HabitableCeiling = [];
    $("input[name='T_HabitableCeiling']").each(function () {
        if (this.checked)
            T_HabitableCeiling.push(this.value);
    })
    var T_HabitableCeilingOther = $("#T_HabitableCeilingOther").val();
    //地面
    var T_HabitableGround = [];
    $("input[name='T_HabitableGround']").each(function () {
        if (this.checked)
            T_HabitableGround.push(this.value);
    })
    var T_HabitableGroundOther = $("#T_HabitableGroundOther").val();
    //卫生的装修情况
    var T_ToiletID = $("#T_ToiletID option:checked").attr("value");
    //卫生间装修情况--内墙
    var T_ToiletInteriorwall = [];
    $("input[name='T_ToiletInteriorwall']").each(function () {
        if (this.checked)
            T_ToiletInteriorwall.push(this.value);
    })
    var T_ToiletInteriorwallOther = $("#T_ToiletInteriorwallOther").val();
    //卫生间装修情况--顶棚
    var T_ToiletCeiling = [];
    $("input[name='T_ToiletCeiling']").each(function () {
        if (this.checked)
            T_ToiletCeiling.push(this.value);
    })
    var T_ToiletCeilingOther = $("#T_ToiletCeilingOther").val();
    //卫生间装修情况--地面
    var T_ToiletGround = [];
    $("input[name='T_ToiletGround']").each(function () {
        if (this.checked)
            T_ToiletGround.push(this.value);
    })
    var T_ToiletGroundOther = $("#T_ToiletGroundOther").val();
    //厨房的装修情况
    var T_KitchenID = $("#T_KitchenID option:checked").attr("value");
    //厨房装修情况--内墙
    var T_KitchenInteriorwall = [];
    $("input[name='T_KitchenInteriorwall']").each(function () {
        if (this.checked)
            T_KitchenInteriorwall.push(this.value);
    })
    var T_KitchenInteriorwallOther = $("#T_KitchenInteriorwallOther").val();
    //厨房装修情况--顶棚
    var T_KitchenCeiling = [];
    $("input[name='T_KitchenCeiling']").each(function () {
        if (this.checked)
            T_KitchenCeiling.push(this.value);
    })
    var T_KitchenCeilingOther = $("#T_KitchenCeilingOther").val();
    //厨房装修情况--地面
    var T_KitchenGround = [];
    $("input[name='T_KitchenGround']").each(function () {
        if (this.checked)
            T_KitchenGround.push(this.value);
    })
    var T_KitchenGroundOther = $("#T_KitchenGroundOther").val();
    //相关说明
    var T_Explain = $("#T_Explain4").val();
    var parms = {
        T_purposeID: T_purposeID,             //--房实际用途编号
        T_Floor: T_Floor,                     //--总楼层
        T_Storey: T_Storey,                   //--所在楼层
        T_OrientationID: T_OrientationID,     //--朝向编号
        T_ResidenceID: T_ResidenceID,         //--住宅类型编号
        T_SeveralBedroom: T_SeveralBedroom,   // --几个卧室
        T_Severaldrawing: T_Severaldrawing,   // --几个客厅
        T_Severalbathroom: T_Severalbathroom,  // --几个卫生间
        T_SeveralKITCHEN: T_SeveralKITCHEN,   // --几个厨房
        T_Severalbalcony: T_Severalbalcony,   //几个阳台
        T_SeveralTerrace: T_SeveralTerrace,    //几个露台
        T_SeveralSmall: T_SeveralSmall,           //几个小院
        T_DrawingID: T_DrawingID,                                         //有无客厅编号（字典）
        T_RoomdescribeID: T_RoomdescribeID,                               //有客厅装修情况描述（字典）
        T_RoomdescribeInteriorwall: T_RoomdescribeInteriorwall.toString(),            //客厅装修选择说明内墙复选框选择值 1,2,3
        T_RoomdescribeInteriorwallOther: T_RoomdescribeInteriorwallOther,  //客厅装修选择说明内墙其它
        T_RoomdescribeCeiling: T_RoomdescribeCeiling.toString(),                      //客厅装修选择说明顶棚复选框选择值 1,2,3
        T_RoomdescribeCeilingOther: T_RoomdescribeCeilingOther,            //客厅装修选择说明顶棚其它
        T_RoomdescribeGround: T_RoomdescribeGround.toString(),                        //客厅装修选择说明地面复选框选择值 1,2,3
        T_RoomdescribeGroundOther: T_RoomdescribeGroundOther,              //客厅装修选择说明地面其它
        T_HabitableID: T_HabitableID,                                      //居室装修情况编号（字典）
        T_HabitableInteriorwall: T_HabitableInteriorwall.toString(),                  //居室装修选择说明内墙复选框选择值 1,2,3
        T_HabitableInteriorwallOther: T_HabitableInteriorwallOther,        //居室装修选择说明内墙其它
        T_HabitableCeiling: T_HabitableCeiling.toString(),                            //居室装修选择说明顶棚复选框选择值 1,2,3
        T_HabitableCeilingOther: T_HabitableCeilingOther,                  //居室装修选择说明顶棚其它
        T_HabitableGround: T_HabitableGround.toString(),                              //居室装修选择说明地面复选框选择值 1,2,3
        T_HabitableGroundOther: T_HabitableGroundOther,                    //居室装修选择说明地面其它
        T_ToiletID: T_ToiletID,                                            //卫生间装修情况编号（字典）
        T_ToiletInteriorwall: T_ToiletInteriorwall.toString(),                        //卫生间装修选择说明内墙复选框选择值 1,2,3
        T_ToiletInteriorwallOther: T_ToiletInteriorwallOther,              //卫生间装修选择说明内墙其它
        T_ToiletCeiling: T_ToiletCeiling.toString(),                                  //卫生间装修选择说明顶棚复选框选择值 1,2,3
        T_ToiletCeilingOther: T_ToiletCeilingOther,                        //卫生间装修选择说明顶棚其它
        T_ToiletGround: T_ToiletGround.toString(),                                    //卫生间装修选择说明地面复选框选择值 1,2,3
        T_ToiletGroundOther: T_ToiletGroundOther,                          //卫生间装修选择说明地面其它
        T_KitchenID: T_KitchenID,                                          //厨房装修情况编号 （字典）
        T_KitchenInteriorwall: T_KitchenInteriorwall.toString(),                      //厨房装修选择说明内墙复选框选择值 1,2,3
        T_KitchenInteriorwallOther: T_KitchenInteriorwallOther,            //厨房装修选择说明内墙其它
        T_KitchenCeiling: T_KitchenCeiling.toString(),                                //厨房装修选择说明顶棚复选框选择值 1,2,3
        T_KitchenCeilingOther: T_KitchenCeilingOther,                      //厨房装修选择说明顶棚其它
        T_KitchenGround: T_KitchenGround.toString(),                                  //厨房装修选择说明地面复选框选择值 1,2,3
        T_KitchenGroundOther: T_KitchenGroundOther,                        //厨房装修选择说明地面其它
        T_Explain: T_Explain,                                             //	 --有关说明           有关说明
        T_ReportNumber: T_ReportNumber,                                   //报告号
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Indoor/Postinsert",
        data: parms,
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                    layer.msg('保存成功!', { icon: 1, time: 1000 });
                }
                else {
                    layer.msg('保存失败!', { icon: 2, time: 2000 });
                }
            }
        }
    })
}
//上传控件的触发方法
function addImages(file, a) {
    var prevDiv = document.getElementById('preview' + a); //显示图片区域
    if (file.files && file.files[0]) {
        var filetype = file.files[0];
        if (!/image\/\w+/.test(filetype.type)) {
            layer.msg('请选择图片进行上传!', { icon: 0, time: 1000 })
            return false;
        }
        else {
            var reader = new FileReader();
            reader.onload = function () {
                //prevDiv.innerHTML = '<img name="image"  src="' + this.result + '" class="preview" />';
                //result.value = this.result;//把文件的结果值
                //var ns = document.getElementById('preview' + a).nextElementSibling.innerHTML;   //获得s的下一个兄弟节点
                var szy = document.createElement("img");
                szy.src = this.result;
                szy.className = "preview";
                var quality = 50;
                szy.src = jiccompress(szy, quality).src;
                var ns = $('#preview' + a + '+div span:first').html();
                prevDiv.innerHTML = '<img name="image"  src="' + szy.src + '" class="preview" />';


                //alert();
                $.ajax({
                    type: "POST",
                    url: ApiUrl + "api/SitePicture/AddSitePicture",
                    data: {
                        T_Pictureurl: szy.src,
                        T_ptype: ".jpg",
                        T_ReportNumber: $("#hdReportNumber").val(),
                        T_Addr: 'preview' + a,
                        T_SpName: ns,   //获得s的下一个兄弟节点
                    },//所有上传文件统一为此对象。result.value 不再截取。type 为文件类型，带.
                    success: function (data) {
                        switch (data) {
                            case -2: layer.msg('修改失败!', { icon: 2, time: 2000 }); break;
                            case -1: layer.msg('上传图片失败!', { icon: 2, time: 2000 }); break;
                            case 0: layer.msg('服务器连接失败!', { icon: 2, time: 2000 }); break;
                            case 1: layer.msg('上传成功!', { icon: 1, time: 2000 }); break;
                            case 2: layer.msg('修改成功!', { icon: 1, time: 2000 }); break;
                            case 3: layer.msg('该状态不允许操作!', { icon: 1, time: 2000 }); break;
                        }

                    }
                });

            }
            reader.readAsDataURL(file.files[0]);
        }

    }
    else {
        prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
    }
}
//控制上传图片的宽高
function jiccompress(source_img_obj, quality) {

    var mime_type = "image/jpeg";
    var cvs = document.createElement('canvas');
    var maxWidth = 500;
    var maxHeight = 500;
    var w = 0;
    var h = 0;

    if (maxWidth / maxHeight <= source_img_obj.naturalWidth / source_img_obj.naturalHeight) //原图片宽高比例 大于 图片框宽高比例  
    {
        w = maxWidth;   //以框的宽度为标准  
        h = maxWidth * (source_img_obj.naturalHeight / source_img_obj.naturalWidth);
    }
    else {   //原图片宽高比例 小于 图片框宽高比例  
        w = maxHeight * (source_img_obj.naturalWidth / source_img_obj.naturalHeight);
        h = maxHeight;   //以框的高度为标准  
    }

    cvs.width = w;
    cvs.height = h;
    source_img_obj.width = w;
    source_img_obj.height = h;
    var ctx = cvs.getContext("2d").drawImage(source_img_obj, 0, 0, w, h);
    var newImageData = cvs.toDataURL(mime_type, quality / 100);
    var result_image_obj = new Image();
    result_image_obj.src = newImageData;
    return result_image_obj;
};

/*权属*/
//房屋所有权证书表的回填显示
function trOwneNumber(state) {
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Ownership/GetOwner",
        data: {
            "": [$("#hdReportNumber").val(), 30, 31, 32, 1],
        },
        success: function (data, status) {
            if (status == "success") {
                var Owner = data[0];
                var list30 = data[1];
                var list31 = data[2];
                var list32 = data[3];
                var list1 = data[4];
                var html = new Array("");
                if (Owner != null) {
                    var html30 = new Array("");
                    $(list30).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_HousingProduction) {
                            html30.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html30.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html31 = new Array("");
                    $(list31).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_SourceAttribute) {
                            html31.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html31.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html32 = new Array("");
                    $(list32).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_CommonSituation) {
                            html32.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html32.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html1 = new Array("");
                    $(list1).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_CardApplication) {
                            html1.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html1.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    //var html33 = new Array("");
                    //$(list1).each(function (i, item) {
                    //    if (list1.DictionaryID == Owner.T_CardApplication) {
                    //        html1.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                    //        return;
                    //    }
                    //    html1.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    //})

                    html.push("<tr><td>房屋所有权证书编号</td><td><input type=\"text\" class=\"input-text\"             value=\"" + Owner.T_OwneNumber + "\" id=\"T_OwneNumber\" name=\"T_OwneNumber\"  /></td></tr>")
                    html.push("<tr><td>房屋产别</td><td> <span class=\"select-box\"> <select id=\"T_HousingProduction\" class=\"select\">" + html30.join("") + "</select>  </span></td></tr>")

                    html.push("<tr><td>产权人</td><td><input type=\"text\" class=\"input-text\"             value=\"" + Owner.T_ProductionName + "\" id=\"T_ProductionName\" name=\"T_ProductionName\" /></td></tr>")
                    html.push("<tr><td>来源属性</td><td> <span class=\"select-box\"> <select  id=\"T_SourceAttribute\"  class=\"select\">" + html31.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>建筑面积</td><td><input type=\"text\" class=\"input-text\"           value=\"" + Owner.T_BuiltUpArea + "\" id=\"T_BuiltUpArea\" name=\"T_BuiltUpArea\"  /></td></tr>")
                    html.push("<tr><td>使用面积</td><td><input type=\"text\" class=\"input-text\"           value=\"" + Owner.T_UseArea + "\" id=\"T_UseArea\" name=\"T_UseArea\" /></td></tr>")
                    html.push("<tr><td>专有建筑面积</td><td><input type=\"text\" class=\"input-text\"       value=\"" + Owner.T_ProperBuiltUpArea + "\" id=\"T_ProperBuiltUpArea\" name=\"T_ProperBuiltUpArea\" /></td></tr>")
                    html.push("<tr><td>证载用途</td><td> <span class=\"select-box\"> <select id=\"T_CardApplication\" class=\"select\">" + html1.join("") + "</select>  </span></td></tr>")
                    if (Owner.T_HouseRegistrationForm == 0) {
                        html.push("<tr><td>房屋登记表</td><td> <span class=\"select-box\"> <select id=\"T_HouseRegistrationForm\" class=\"select\"><option value='0'  selected=\"selected\">有</option><option value='1'>无</option></select>  </span></td></tr>")
                    }
                    else {
                        html.push("<tr><td>房屋登记表</td><td> <span class=\"select-box\"> <select id=\"T_HouseRegistrationForm\" class=\"select\"><option value='0' >有</option><option value='1'  selected=\"selected\">无</option></select>  </span></td></tr>")
                    }
                    html.push("<tr><td>共有情况</td><td> <span class=\"select-box\"> <select id=\"T_CommonSituation\" class=\"select\">" + html32.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>共有份额</td><td><input type=\"text\" class=\"input-text\"           value=\"" + Owner.T_ShareCommon + "\" id=\"T_ShareCommon\" name=\"T_ShareCommon\" placeholder=\"请输入金额\" /></td></tr>")
                    html.push("<tr><td>房产证登记时间</td><td><input type=\"text\" id=\"T_ProductionDate\"  value=\"" + Owner.T_ProductionDate + "\" onClick=\"WdatePicker({dateFmt:'yyyy/MM/dd'})\" class=\"input-text Wdate\"   /></td></tr>")
                    if (Owner.T_ProductionIS == 0) {
                        html.push("<tr><td>是否为新房本</td><td> <span class=\"select-box\"> <select id=\"T_ProductionIS\" class=\"select\"><option value='0' selected=\"selected\">是</option><option value='1'>否</option></select>  </span></td></tr>")
                    }
                    else {
                        html.push("<tr><td>是否为新房本</td><td> <span class=\"select-box\"> <select id=\"T_ProductionIS\" class=\"select\"><option value='0'>是</option><option value='1' selected=\"selected\">否</option></select>  </span></td></tr>")
                    }
                } else {

                    var html30 = new Array("");
                    $(list30).each(function (i, item) {
                        html30.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html31 = new Array("");
                    $(list31).each(function (i, item) {
                        html31.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html32 = new Array("");
                    $(list32).each(function (i, item) {
                        html32.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html1 = new Array("");
                    $(list1).each(function (i, item) {
                        html1.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })

                    html.push("<tr><td>房屋所有权证书编号</td><td><input type=\"text\" class=\"input-text\"            id=\"T_OwneNumber\" name=\"T_OwneNumber\"  /></td></tr>")
                    html.push("<tr><td>房屋产别</td><td> <span class=\"select-box\"> <select id=\"T_HousingProduction\" class=\"select\">" + html30.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>产权人</td><td><input type=\"text\" class=\"input-text\" id=\"T_ProductionName\" name=\"T_ProductionName\"  /></td></tr>")
                    html.push("<tr><td>来源属性</td><td> <span class=\"select-box\"> <select id=\"T_SourceAttribute\" class=\"select\">" + html31.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>建筑面积</td><td><input type=\"text\" class=\"input-text\" id=\"T_BuiltUpArea\" name=\"T_BuiltUpArea\"  /></td></tr>")
                    html.push("<tr><td>使用面积</td><td><input type=\"text\" class=\"input-text\" id=\"T_UseArea\" name=\"T_UseArea\"  /></td></tr>")
                    html.push("<tr><td>专有建筑面积</td><td><input type=\"text\" class=\"input-text\" id=\"T_ProperBuiltUpArea\" name=\"T_ProperBuiltUpArea\" /></td></tr>")
                    html.push("<tr><td>证载用途</td><td> <span class=\"select-box\"> <select id=\"T_CardApplication\" class=\"select\">" + html1.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>房屋登记表</td><td> <span class=\"select-box\"> <select id=\"T_HouseRegistrationForm\" class=\"select\"><option value='0'>有</option><option value='1'>无</option></select>  </span></td></tr>")
                    html.push("<tr><td>共有情况</td><td> <span class=\"select-box\"> <select id=\"T_CommonSituation\" class=\"select\">" + html32.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>共有份额</td><td><input type=\"text\" class=\"input-text\" id=\"T_ShareCommon\" name=\"T_ShareCommon\"  /></td></tr>")
                    html.push("<tr><td>房产证登记时间</td><td><input type=\"text\" id=\"T_ProductionDate\"  onClick=\"WdatePicker({dateFmt:'yyyy/MM/dd'})\" class=\"input-text Wdate\"   /></td></tr>")
                    html.push("<tr><td>是否为新房本</td><td> <span class=\"select-box\"> <select id=\"T_ProductionIS\" class=\"select\"><option value='0'>是</option><option value='1'>否</option></select>  </span></td></tr>")
                }
                if (state == 1 || state == 2) {
                    html.push("<tr><td colspan=\"2\"><a class=\"btn btn-primary radius\" onclick=\"Insertown()\" href=\"javascript:;\"><i class=\"Hui-iconfont\">&#xe600;</i> 登记</a></td></tr>")

                }

                $("#MyQuanShuMx").empty();
                $("#MyQuanShuMx").append(html.join(""));
            }
        }
    })
}
//不动产权证书表信息的回填显示
function trRealNumber(state) {
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Ownership/GetRea",
        data: {
            "": [$("#hdReportNumber").val(), 30, 31, 32, 1],
        },
        success: function (data, status) {
            if (status == "success") {
                var Owner = data[0];
                var list30 = data[1];
                var list31 = data[2];
                var list32 = data[3];
                var list1 = data[4];
                var html = new Array("");
                if (Owner != null) {
                    var html30 = new Array("");
                    $(list30).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_HousingProduction) {
                            html30.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html30.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html31 = new Array("");
                    $(list31).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_SourceAttribute) {
                            html31.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html31.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html32 = new Array("");
                    $(list32).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_CommonSituation) {
                            html32.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html32.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html1 = new Array("");
                    $(list1).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_CardApplication) {
                            html1.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html1.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    html.push("<tr><td>不动产权证书书编号</td><td><input type=\"text\" class=\"input-text\"             value=\"" + Owner.T_RealNumber + "\" id=\"T_RealNumber\" name=\"T_OwneNumber\"  /></td></tr>")

                    html.push("<tr><td>房屋产别</td><td> <span class=\"select-box\"> <select id=\"T_HousingProduction\" class=\"select\">" + html30.join("") + "</select>  </span></td></tr>")

                    html.push("<tr><td>产权人</td><td><input type=\"text\" class=\"input-text\"             value=\"" + Owner.T_ProductionName + "\" id=\"T_ProductionName\" name=\"T_ProductionName\" /></td></tr>")
                    html.push("<tr><td>来源属性</td><td> <span class=\"select-box\"> <select  id=\"T_SourceAttribute\"  class=\"select\">" + html31.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>建筑面积</td><td><input type=\"text\" class=\"input-text\"           value=\"" + Owner.T_BuiltUpArea + "\" id=\"T_BuiltUpArea\" name=\"T_BuiltUpArea\"  /></td></tr>")
                    html.push("<tr><td>使用面积</td><td><input type=\"text\" class=\"input-text\"           value=\"" + Owner.T_UseArea + "\" id=\"T_UseArea\" name=\"T_UseArea\" /></td></tr>")
                    html.push("<tr><td>专有建筑面积</td><td><input type=\"text\" class=\"input-text\"       value=\"" + Owner.T_ProperBuiltUpArea + "\" id=\"T_ProperBuiltUpArea\" name=\"T_ProperBuiltUpArea\" /></td></tr>")
                    html.push("<tr><td>证载用途</td><td> <span class=\"select-box\"> <select id=\"T_CardApplication\" class=\"select\">" + html1.join("") + "</select>  </span></td></tr>")
                    if (Owner.T_HouseRegistrationForm == 0) {
                        html.push("<tr><td>房屋登记表</td><td> <span class=\"select-box\"> <select id=\"T_HouseRegistrationForm\" class=\"select\"><option value='0'  selected=\"selected\">有</option><option value='1'>无</option></select>  </span></td></tr>")
                    }
                    else {
                        html.push("<tr><td>房屋登记表</td><td> <span class=\"select-box\"> <select id=\"T_HouseRegistrationForm\" class=\"select\"><option value='0' >有</option><option value='1'  selected=\"selected\">无</option></select>  </span></td></tr>")
                    }
                    html.push("<tr><td>共有情况</td><td> <span class=\"select-box\"> <select id=\"T_CommonSituation\" class=\"select\">" + html32.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>共有份额</td><td><input type=\"text\" class=\"input-text\"           value=\"" + Owner.T_ShareCommon + "\" id=\"T_ShareCommon\" name=\"T_ShareCommon\" placeholder=\"请输入金额\" /></td></tr>")
                    html.push("<tr><td>不动产权证登记时间</td><td><input type=\"text\" id=\"T_ProductionDate\"  value=\"" + Owner.T_ProductionDate + "\" onClick=\"WdatePicker({dateFmt:'yyyy/MM/dd'})\" class=\"input-text Wdate\"   /></td></tr>")
                    if (Owner.T_ProductionIS == 0) {
                        html.push("<tr><td>是否为新房本</td><td> <span class=\"select-box\"> <select id=\"T_ProductionIS\" class=\"select\"><option value='0' selected=\"selected\">是</option><option value='1'>否</option></select>  </span></td></tr>")
                    }
                    else {
                        html.push("<tr><td>是否为新房本</td><td> <span class=\"select-box\"> <select id=\"T_ProductionIS\" class=\"select\"><option value='0'>是</option><option value='1' selected=\"selected\">否</option></select>  </span></td></tr>")
                    }

                } else {

                    var html30 = new Array("");
                    $(list30).each(function (i, item) {
                        html30.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html31 = new Array("");
                    $(list31).each(function (i, item) {
                        html31.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html32 = new Array("");
                    $(list32).each(function (i, item) {
                        html32.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html1 = new Array("");
                    $(list1).each(function (i, item) {
                        html1.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    html.push("<tr><td>不动产权证书书编号</td><td><input type=\"text\" class=\"input-text\"             id=\"T_RealNumber\" name=\"T_OwneNumber\"  /></td></tr>")

                    html.push("<tr><td>房屋产别</td><td> <span class=\"select-box\"> <select id=\"T_HousingProduction\" class=\"select\">" + html30.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>产权人</td><td><input type=\"text\" class=\"input-text\" id=\"T_ProductionName\" name=\"T_ProductionName\"  /></td></tr>")
                    html.push("<tr><td>来源属性</td><td> <span class=\"select-box\"> <select id=\"T_SourceAttribute\" class=\"select\">" + html31.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>建筑面积</td><td><input type=\"text\" class=\"input-text\" id=\"T_BuiltUpArea\" name=\"T_BuiltUpArea\"  /></td></tr>")
                    html.push("<tr><td>使用面积</td><td><input type=\"text\" class=\"input-text\" id=\"T_UseArea\" name=\"T_UseArea\"  /></td></tr>")
                    html.push("<tr><td>专有建筑面积</td><td><input type=\"text\" class=\"input-text\" id=\"T_ProperBuiltUpArea\" name=\"T_ProperBuiltUpArea\" /></td></tr>")
                    html.push("<tr><td>证载用途</td><td> <span class=\"select-box\"> <select id=\"T_CardApplication\" class=\"select\">" + html1.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>房屋登记表</td><td> <span class=\"select-box\"> <select id=\"T_HouseRegistrationForm\" class=\"select\"><option value='0'>有</option><option value='1'>无</option></select>  </span></td></tr>")
                    html.push("<tr><td>共有情况</td><td> <span class=\"select-box\"> <select id=\"T_CommonSituation\" class=\"select\">" + html32.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>共有份额</td><td><input type=\"text\" class=\"input-text\" id=\"T_ShareCommon\" name=\"T_ShareCommon\"  /></td></tr>")
                    html.push("<tr><td>不动产权证登记时间</td><td><input type=\"text\" id=\"T_ProductionDate\"  onClick=\"WdatePicker({dateFmt:'yyyy/MM/dd'})\" class=\"input-text Wdate\"   /></td></tr>")
                    html.push("<tr><td>是否为新房本</td><td> <span class=\"select-box\"> <select id=\"T_ProductionIS\" class=\"select\"><option value='0'>是</option><option value='1'>否</option></select>  </span></td></tr>")
                }
                if (state == 1 || state == 2) {
                    html.push("<tr><td colspan=\"2\"><a class=\"btn btn-primary radius\" onclick=\"InsertRea()\" href=\"javascript:;\"><i class=\"Hui-iconfont\">&#xe600;</i> 登记</a></td></tr>")

                }

                $("#MyQuanShuMx1").empty();
                $("#MyQuanShuMx1").append(html.join(""));
            }
        }
    })
}
//完税证明   中华人民共和国税收完税证明表的回填显示
function trTaxNumber(state) {
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Ownership/GetTax",
        data: { "": $("#hdReportNumber").val() },
        success: function (data, status) {
            if (status == "success") {
                var html = new Array("");
                if (data != null) {

                    html.push("<tr><td>国税收完税证明编号</td><td><input type=\"text\" class=\"input-text\"        value=\"" + data.T_TaxNumber + "\" id=\"T_TaxNumber\" name=\"T_OwneNumber\" /></td></tr>")
                    html.push("<tr><td>金额</td><td><input type=\"text\" class=\"input-text\" id=\"TaxT_Price\" name=\"TaxT_Price\" placeholder=\"请输入金额\" value=\"" + data.T_Price + "\" /></td></tr>")
                } else {
                    html.push("<tr><td>国税收完税证明编号</td><td><input type=\"text\" class=\"input-text\"          id=\"T_TaxNumber\" name=\"T_OwneNumber\" /></td></tr>")
                    html.push("<tr><td>金额</td><td><input type=\"text\" class=\"input-text\" id=\"TaxT_Price\" name=\"TaxT_Price\" placeholder=\"请输入金额\" /></td></tr>")
                }
                if (state == 1 || state == 2) {
                    html.push("<tr><td colspan=\"2\"><a class=\"btn btn-primary radius\" onclick=\"InsertTax()\" href=\"javascript:;\"><i class=\"Hui-iconfont\">&#xe600;</i> 登记</a></td></tr>")

                }


                $("#MyQuanShuMx2").empty();
                $("#MyQuanShuMx2").append(html.join(""));
            }
        }
    })
}
//存量房屋买卖合同表的回填显示
function trBusinessNumber(state) {
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Ownership/GetBus",
        data: {
            "": [$("#hdReportNumber").val(), 30, 31],
        },
        success: function (data, status) {
            if (status == "success") {
                var Owner = data[0];
                var list30 = data[1];
                var list31 = data[2];
                var html = new Array("");
                if (Owner != null) {
                    var html30 = new Array("");
                    $(list30).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_HousingProduction) {
                            html30.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html30.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html31 = new Array("");
                    $(list31).each(function (i, item) {
                        if (item.DictionaryID == Owner.T_SourceAttribute) {
                            html31.push("<option value=" + item.DictionaryID + " selected=\"selected\">" + item.DictionaryName + "</option>")
                            return;
                        }
                        html31.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    html.push("<tr><td>存量房屋买卖合同编号</td><td><input type=\"text\" class=\"input-text\"        value=\"" + Owner.T_BusinessNumber + "\" id=\"T_BusinessNumber\" name=\"T_OwneNumber\" /></td></tr>")
                    html.push("<tr><td>房屋产别</td><td> <span class=\"select-box\"> <select id=\"T_HousingProduction\" class=\"select\">" + html30 + "</select>  </span></td></tr>")
                    html.push("<tr><td>出卖人</td><td><input type=\"text\" class=\"input-text\"             value=\"" + Owner.T_Seller + "\" id=\"T_Seller\" name=\"T_Seller\"  /></td></tr>")
                    html.push("<tr><td>买受人</td><td><input type=\"text\" class=\"input-text\"           value=\"" + Owner.T_Person + "\" id=\"T_Person\" name=\"T_Person\" /></td></tr>")
                    html.push("<tr><td>来源属性</td><td> <span class=\"select-box\"> <select id=\"T_HousingProduction\" class=\"select\">" + html31.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>建筑面积</td><td><input type=\"text\" class=\"input-text\"           value=\"" + Owner.T_BuiltUpArea + "\" id=\"T_BuiltUpArea\" name=\"T_BuiltUpArea\"  /></td></tr>")
                    html.push("<tr><td>卖合同编签订时间</td><td><input type=\"text\" id=\"T_BcDate\"  value=\"" + Owner.T_BcDate + "\" onClick=\"WdatePicker({dateFmt:'yyyy/MM/dd'})\" class=\"input-text Wdate\"   /></td></tr>")
                } else {
                    var html30 = new Array("");
                    $(list30).each(function (i, item) {
                        html30.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    var html31 = new Array("");
                    $(list31).each(function (i, item) {
                        html31.push("<option value=" + item.DictionaryID + ">" + item.DictionaryName + "</option>")
                    })
                    html.push("<tr><td>存量房屋买卖合同编号</td><td><input type=\"text\" class=\"input-text\"       id=\"T_BusinessNumber\" name=\"T_OwneNumber\" /></td></tr>")
                    html.push("<tr><td>房屋产别</td><td> <span class=\"select-box\"> <select id=\"T_HousingProduction\" class=\"select\">" + html30.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>出卖人</td><td><input type=\"text\" class=\"input-text\" id=\"T_Seller\" name=\"T_Seller\" /></td></tr>")
                    html.push("<tr><td>买受人</td><td><input type=\"text\" class=\"input-text\" id=\"T_Person\" name=\"T_Person\"  /></td></tr>")
                    html.push("<tr><td>来源属性</td><td> <span class=\"select-box\"> <select id=\"T_HousingProduction\" class=\"select\">" + html31.join("") + "</select>  </span></td></tr>")
                    html.push("<tr><td>建筑面积</td><td><input type=\"text\" class=\"input-text\" id=\"T_BuiltUpArea\" name=\"T_BuiltUpArea\"  /></td></tr>")
                    html.push("<tr><td>卖合同编签订登记时间</td><td><input type=\"text\" id=\"T_BcDate\" onClick=\"WdatePicker({dateFmt:'yyyy/MM/dd'})\" class=\"input-text Wdate\"   /></td></tr>")
                }
                if (state == 1 || state == 2) {
                    html.push("<tr><td colspan=\"2\"><a class=\"btn btn-primary radius\" onclick=\"InsertBus()\" href=\"javascript:;\"><i class=\"Hui-iconfont\">&#xe600;</i> 登记</a></td></tr>")

                }
                $("#MyQuanShuMx3").empty();
                $("#MyQuanShuMx3").append(html);
            }
        }
    })
}
//复印件图片的回传显示
function imgs() {
    //图片的回传显示
    $.ajax({
        type: "get",
        url: ApiUrl + "api/SitePicture/Picture",
        async: false,
        data: {
            T_ReportNumber: $("#hdReportNumber").val()
        },
        success: function (data, status) {
            $("#dd").empty();
            $("#dd1").empty();
            $("#dd2").empty();
            $(data).each(function (i, item) {
                if (item.T_Addr == 'dd') {
                    $("#dd").append("<div style='float:left;margin-left:10px' > <img   src=" + ApiUrl + item.T_Pictureurl + "  /></div>");
                }
                if (item.T_Addr == 'dd1') {
                    $("#dd1").append("<div style='float:left;margin-left:10px' > <img   src=" + ApiUrl + item.T_Pictureurl + "  /></div>");
                }
                if (item.T_Addr == 'dd2') {
                    $("#dd2").append("<div style='float:left;margin-left:10px' > <img   src=" + ApiUrl + item.T_Pictureurl + "  /></div>");
                }
                //   document.getElementById(item.SP_Addr).innerHTML = '<img id="image"  src="' + item.SP_Picturename + '" />';
            })
        }
    })
}
//房屋所有权证书表的信息操作
function Insertown() {
    if ($("#T_OwneNumber").val() == "" || $("#T_OwneNumber").val() == undefined || $("#T_OwneNumber").val() == null)
    {
        layer.msg('房屋所有权证书编号!必须填写', { icon: 2, time: 2000 });
        return;
    }
    var parms = {
        T_ReportNumber: $("#hdReportNumber").val(),  //报告号的获取         
        T_OwneNumber: $("#T_OwneNumber").val(),      //房屋所有权证书编号（如：京房权证延私字第11209号）    
        T_HousingProduction: $("#T_HousingProduction").val(),  //房屋产别（字典)
        T_ProductionName: $("#T_ProductionName").val(),  //产权人         
        T_SourceAttribute: $("#T_SourceAttribute").val(),      //来源属性 （字典） 
        T_BuiltUpArea: $("#T_BuiltUpArea").val(),  //建筑面积         
        T_UseArea: $("#T_UseArea").val(),      //使用面积
        T_ProperBuiltUpArea: $("#T_ProperBuiltUpArea").val(),  //专有建筑面积         
        T_CardApplication: $("#T_CardApplication").val(),      //证载用途
        T_HouseRegistrationForm: $("#T_HouseRegistrationForm").val(),  //房屋登记表（字典）--暂时写死 有/无         
        T_CommonSituation: $("#T_CommonSituation").val(),      //共有情况（字典） 
        T_ShareCommon: $("#T_ShareCommon").val(),  //共有份额         
        T_ProductionDate: $("#T_ProductionDate").val(),      //房产证登记时间       
        T_ProductionIS: $("#T_ProductionIS").val(),    //是否为新房本（字典）--暂时写死 是/否
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Ownership/InsertOrUpdateOwner",
        data: parms,
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {

                    layer.msg('保存成功!', { icon: 1, time: 2000 });
                }
                else {
                    layer.msg('保存失败!', { icon: 1, time: 2000 });
                }
            }
        }
    })

}
//不动产权证书表的信息操作
function InsertRea() {
    if ($("#T_RealNumber").val() == "" || $("#T_RealNumber").val() == undefined || $("#T_RealNumber").val() == null) {
        layer.msg('不动产权证书书编号!必须填写', { icon:2, time: 2000 });
        return;
    }
    var parms = {
        T_ReportNumber: $("#hdReportNumber").val(),  //报告号的获取         
        T_RealNumber: $("#T_RealNumber").val(),      //不动产权证书书编号（如：京（2016）延庆区不动产权第0014071号）
        T_HousingProduction: $("#T_HousingProduction").val(),  //房屋产别（字典)

        T_ProductionName: $("#T_ProductionName").val(),  //产权人         
        T_SourceAttribute: $("#T_SourceAttribute").val(),      //来源属性 （字典） 
        T_BuiltUpArea: $("#T_BuiltUpArea").val(),  //建筑面积         
        T_UseArea: $("#T_UseArea").val(),      //使用面积
        T_ProperBuiltUpArea: $("#T_ProperBuiltUpArea").val(),  //专有建筑面积         
        T_CardApplication: $("#T_CardApplication").val(),      //证载用途
        T_HouseRegistrationForm: $("#T_HouseRegistrationForm").val(),  //房屋登记表（字典）--暂时写死 有/无         
        T_CommonSituation: $("#T_CommonSituation").val(),      //共有情况（字典） 
        T_ShareCommon: $("#T_ShareCommon").val(),  //共有份额         
        T_ProductionDate: $("#T_ProductionDate").val(),      //房产证登记时间
        T_ProductionIS: $("#T_ProductionIS").val(),    //是否为新房本（字典）--暂时写死 是/否           

    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Ownership/InsertOrUpdateRea",
        data: parms,
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                    layer.msg('保存成功!', { icon: 1, time: 2000 });
                }
                else {
                    layer.msg('保存失败!', { icon: 1, time: 2000 });
                }
            }
        }
    })

}
//完税证明   中华人民共和国税收完税证明表的操作
function InsertTax() {
    if ($("#T_TaxNumber").val() == "" || $("#T_TaxNumber").val() == undefined || $("#T_TaxNumber").val() == null) {
        layer.msg('国税收完税证明编号!必须填写', { icon: 2, time: 2000 });
        return;
    }
    var parms = {
        T_ReportNumber: $("#hdReportNumber").val(),  //报告号的获取         
        T_TaxNumber: $("#T_TaxNumber").val(),      //国税收完税证明编号（如：京地证00865282）                
        T_Price: $("#TaxT_Price").val()     //金额               
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Ownership/InsertOrUpdateTax",
        data: parms,
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                    layer.msg('保存成功!', { icon: 1, time: 2000 });
                }
                else {
                    layer.msg('保存失败!', { icon: 1, time: 2000 });
                }
            }
        }
    })



}
//存量房屋买卖合同表的操作
function InsertBus() {
    if ($("#T_BusinessNumber").val() == "" || $("#T_BusinessNumber").val() == undefined || $("#T_BusinessNumber").val() == null) {
        layer.msg('存量房屋买卖合同编号!必须填写', { icon: 2, time: 2000 });
        return;
    }
    var parms = {
        T_ReportNumber: $("#hdReportNumber").val(),  //报告号的获取         
        T_BusinessNumber: $("#T_BusinessNumber").val(),      //存量房屋买卖合同编号（如：房屋买卖合第0014071号）
        T_HousingProduction: $("#T_HousingProduction").val(),  //房屋产别（字典）  
        T_Seller: $("#T_Seller").val(),  //出卖人   
        T_Person: $("#T_Person").val(),  //买受人  
        T_SourceAttribute: $("#T_SourceAttribute").val(),      //来源属性 （字典） 
        T_BuiltUpArea: $("#T_BuiltUpArea").val(),  //建筑面积         
        T_BcDate: $("#T_BcDate").val(),      //签订时间
    }
    $.ajax({
        type: "post",
        url: ApiUrl + "api/Ownership/InsertOrUpdateBus",
        data: parms,
        success: function (data, status) {
            if (status == "success") {
                if (data == true) {
                    layer.msg('保存成功!', { icon: 1, time: 2000 });
                }
                else {
                    layer.msg('保存失败!', { icon: 1, time: 2000 });
                }
            }
        }
    })

}
